package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysDynamicMapper;
import com.ruoyi.project.system.domain.SysDynamic;
import com.ruoyi.project.system.service.ISysDynamicService;

/**
 * 动态Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-16
 */
@Service
public class SysDynamicServiceImpl implements ISysDynamicService 
{
    @Autowired
    private SysDynamicMapper sysDynamicMapper;

    /**
     * 查询动态
     * 
     * @param dynamicId 动态ID
     * @return 动态
     */
    @Override
    public SysDynamic selectSysDynamicById(Long dynamicId)
    {
        return sysDynamicMapper.selectSysDynamicById(dynamicId);
    }

    /**
     * 查询动态列表
     * 
     * @param sysDynamic 动态
     * @return 动态
     */
    @Override
    public List<SysDynamic> selectSysDynamicList(SysDynamic sysDynamic)
    {
        return sysDynamicMapper.selectSysDynamicList(sysDynamic);
    }

    /**
     * 新增动态
     * 
     * @param sysDynamic 动态
     * @return 结果
     */
    @Override
    public int insertSysDynamic(SysDynamic sysDynamic)
    {
        sysDynamic.setCreateTime(DateUtils.getNowDate());
        return sysDynamicMapper.insertSysDynamic(sysDynamic);
    }

    /**
     * 修改动态
     * 
     * @param sysDynamic 动态
     * @return 结果
     */
    @Override
    public int updateSysDynamic(SysDynamic sysDynamic)
    {
        sysDynamic.setUpdateTime(DateUtils.getNowDate());
        return sysDynamicMapper.updateSysDynamic(sysDynamic);
    }

    /**
     * 批量删除动态
     * 
     * @param dynamicIds 需要删除的动态ID
     * @return 结果
     */
    @Override
    public int deleteSysDynamicByIds(Long[] dynamicIds)
    {
        return sysDynamicMapper.deleteSysDynamicByIds(dynamicIds);
    }

    /**
     * 删除动态信息
     * 
     * @param dynamicId 动态ID
     * @return 结果
     */
    @Override
    public int deleteSysDynamicById(Long dynamicId)
    {
        return sysDynamicMapper.deleteSysDynamicById(dynamicId);
    }
}
